﻿@model TesisProj.Areas.Simulaciones.Models.Asignacion
@using TesisProj.Areas.Distribuciones.Models
@using TesisProj.Areas.Modelos.Models
@using TesisProj.Areas.Proyectos.Models
@using Telerik.Web.Mvc.UI

@{
    ViewBag.Title = "Parametros";
    Layout = "~/Views/Shared/_Layout.cshtml";
    ModeloSimlacion mL = (ModeloSimlacion)Session["Modelo"];
}

<h2>Asignacion de Distribucion a parametro</h2>

@using (Html.BeginForm())
{
    
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Asignación</legend>
        <div class="conteiner">
            <div class="span3 label label-inverse">@Html.LabelFor(model => model.Celdas.Nombre) @Html.Telerik().AutoCompleteFor(model => model.Celdas.Nombre).HtmlAttributes(new { style = "width: 200px" })</div>
            <div class="span3 label label-inverse">@Html.LabelFor(model => model.Celdas.valor)  @Html.Telerik().AutoCompleteFor(model => model.Celdas.valor).HtmlAttributes(new { style = "width: 100px" })</div>
            <div class="span3 label label-inverse">@Html.LabelFor(model => model.Celdas.interes)@Html.Telerik().AutoCompleteFor(model => model.Celdas.interes).HtmlAttributes(new { style = "width: 100px" })</div>
        </div>
        <br /><br /><br /><br />
@*        <div class="conteiner">
            <div class="span3 label label-inverse">
                <label>Distribucion:</label>
                    @( Html.Telerik().DropDownList()
                            .Name("Distribuciones")
                            .BindTo(new SelectList((System.Collections.IEnumerable)ViewData["Distribuciones"], "Id", "NombreCorto"))
                            .Placeholder("Seleccione una distribucion...")
                            .HtmlAttributes(new { @style = "width:100%" })
                            .CascadeTo("Modelos")
                    )
            </div>
            <div class="span3 label label-inverse">
                <label>Modelo:</label>
                    @( Html.Telerik().DropDownList()
                            .Name("Modelos")
                            .DataBinding(binding => binding.Ajax().Select("_GetModelos", "Parametro"))
                            .HtmlAttributes(new { @style = "width:100%" })
                            .Placeholder("Selecione un modelo...")
                            .ClientEvents(events => events.OnChange("OnChange"))
                    )
            </div>
        </div>*@
        <br /><br /><br />
            <h1>Calendario a Simular</h1>
     <table>
        <tr>
            @foreach (Pedro_Elemento e in Model.Celdas.Elementos)
            {
                <th>@e.Nombre.Replace("Periodo","")</th>
            }
        </tr>
        <tr>
            @foreach (Pedro_Elemento e in Model.Celdas.Elementos)
            {
                <td>@(e.valor)</td>
            }
        </tr>
    </table>
    </fieldset>

}

<script>
    function OnChange(e) {
        var modelo = $("#Modelos").val();
        $.getJSON('@Url.Action("_GetModelo", "Parametro", new {Area ="Simulaciones"})',
            { modelo: modelo })
    }
</script>


<table>
    <tr>
        <td><div class="btn btn-inverse">@Html.ActionLink("Binomial","Index","Binomial",null,new {@style="color:white;"}) </div></td>
        <td><div class="btn btn-inverse">@Html.ActionLink("Geometrica","Index","Geometrica",null,new {@style="color:white;"}) </div></td>
        <td><div class="btn btn-inverse">@Html.ActionLink("Hipergeometrica","Index","Hipergeometrica",null,new {@style="color:white;"}) </div></td>
        <td><div class="btn btn-inverse">@Html.ActionLink("Pascal","Index","Pascal",null,new {@style="color:white;"}) </div></td>
        <td><div class="btn btn-inverse">@Html.ActionLink("Poisson","Index","Poisson",null,new {@style="color:white;"}) </div></td>
    </tr>
    <tr>
        <td><div class="btn btn-inverse">@Html.ActionLink("Normal","Index","Normal",null,new {@style="color:white;"}) </div></td>
        <td><div class="btn btn-inverse">@Html.ActionLink("Uniforme","Index","Uniforme",null,new {@style="color:white;"}) </div></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
</table>
